<?php
class String{
	public function extract($string="",$maxlength=100 ){
		$str = explode(" ",$string );
		$output="";
		foreach($str as $word){
			$output.=" ".$word;
			if(strlen($output)>$maxlength) return $output;
		}
		return $output;
	}
}
?>